﻿using System;

// ReSharper disable CheckNamespace
namespace System.Collections.Generic
// ReSharper restore CheckNamespace
{
    public static class EnumerableExtensions
    {
        /// <summary>
        /// Perform an action on each item in the enumerable
        /// </summary>
        public static void ForEach<T>(this IEnumerable<T> items, Action<T> foreachAction)
        {
            if (items == null)
                return;

            foreach (var item in items)
                foreachAction(item);
        }
    }
}
